//商品管理
import request from '@/utils/request'
//获取所有商品
//url: "/api/wares" post
export const reqWaresList = (data) => request({ url: '/wares', method: 'post', data });
//下架商品
//url: /api/wares/delete/{waresId} post
export const reqDeleteWares = (waresId) => request({ url: `/wares/delete/${waresId}`, method: 'post' })
//增加或修改商品
export const reqAddOrUpdateWares = (data) => {
    if (data.waresId) {
        return request({ url: '/wares/update', method: 'post', data });
    } else {
        return request({ url: `/wares/insert`, method: 'post', data });
    }
}